From 7410024e984cc80da365913615ae8293aa698ccc Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Thu, 17 Jan 2008 12:05:44 -0700 Subject: [PATCH] [IA64] Cleanup duplicate kdump_find_rsvd_region() Signed-off-by: Akio Takebe --- xen/arch/ia64/linux-xen/efi.c | 50 +++-------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/xen/arch/ia64/linux-xen/efi.c b/xen/arch/ia64/linux-xen/efi.c index c4d59cfeb3..ecc64f730e 100644 --- a/xen/arch/ia64/linux-xen/efi.c +++ b/xen/arch/ia64/linux-xen/efi.c @@ -1211,8 +1211,9 @@ efi_initialize_iomem_resources(struct resource *code_resource, } } } +#endif /* XEN */ -#ifdef CONFIG_KEXEC +#if defined(CONFIG_KEXEC) || defined(XEN) /* find a block of memory aligned to 64M exclude reserved regions rsvd_regions are sorted */ @@ -1258,6 +1259,7 @@ kdump_find_rsvd_region (unsigned long size, } #endif +#ifndef XEN #ifdef CONFIG_PROC_VMCORE /* locate the size find a the descriptor at a certain address */ unsigned long @@ -1288,49 +1290,3 @@ vmcore_find_descriptor_size (unsigned long address) } #endif #endif /* XEN */ - -#ifdef XEN -/* find a block of memory aligned to 64M exclude reserved regions - * rsvd_regions are sorted - */ -unsigned long -kdump_find_rsvd_region(unsigned long size, struct rsvd_region *r, int n) -{ - int i; - u64 start, end; - u64 alignment = 1UL << _PAGE_SIZE_64M; - void *efi_map_start, *efi_map_end, *p; - efi_memory_desc_t *md; - u64 efi_desc_size; - - efi_map_start = __va(ia64_boot_param->efi_memmap); - efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; - efi_desc_size = ia64_boot_param->efi_memdesc_size; - - for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { - md = p; - if (!efi_wb(md)) - continue; - start = ALIGN(md->phys_addr, alignment); - end = efi_md_end(md); - for (i = 0; i < n; i++) { - if (__pa(r[i].start) >= start && __pa(r[i].end) < end) { - if (__pa(r[i].start) > start + size) - return start; - start = ALIGN(__pa(r[i].end), alignment); - if (i < n - 1 - && __pa(r[i + 1].start) < start + size) - continue; - else - break; - } - } - if (end > start + size) - return start; - } - - printk(KERN_WARNING - "Cannot reserve 0x%lx byte of memory for crashdump\n", size); - return ~0UL; -} -#endif -- 2.30.2